import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'VideoCenter',
        redirect: { name: 'home' },
    },
    {
        path: '/home',
        name: 'home',
        component: () =>
            import ('@/views/home/home.vue'),
    },
    {
        path: '/account',
        name: 'Account',
        component: () =>
            import ('@/views/userAdmin/Account.vue'),
        redirect: { name: 'Info' },
        children: [{
                path: 'info',
                name: 'Info',
                component: () =>
                    import ('@/views/userAdmin/Info.vue') //个人资料
            },
            {
                path: 'personalAuth',
                name: 'PersonalAuth',
                component: () =>
                    import ('@/views/userAdmin/personalAuth.vue') //个人实名
            },
            {
                path: 'companyAuth',
                name: 'companyAuth',
                component: () =>
                    import ('@/views/userAdmin/companyAuth.vue') //企业实名
            },
            {
                path: 'companyOfficial',
                name: 'companyOfficial',
                component: () =>
                    import ('@/views/userAdmin/companyOfficial.vue') //官方实名
            },
            {
                path: 'noticeDetail/:id',
                name: 'NoticeDetail',
                component: () =>
                    import ('@/views/userAdmin/noticeDetail.vue') //公告详情
            },
            {
                path: 'onlineRecord',
                name: 'onlineRecord',
                component: () =>
                    import ('@/views/userAdmin/onlineRecord.vue') //公告详情
            },
            {
                path: 'recharge',
                name: 'Recharge',
                component: () =>
                    import ('@/views/userAdmin/recharge.vue') //充值
            },
            {
                path: 'edit/:id',
                name: 'EditPro',
                component: () =>
                    import ('@/views/userAdmin/EditPro.vue') //修改作品
            },
            {
                path: 'sale',
                name: 'SaleRecord',
                component: () =>
                    import ('@/views/userAdmin/SaleRecord.vue') //销售记录
            },
            {
                path: 'buy',
                name: 'BuyRecord',
                component: () =>
                    import ('@/views/userAdmin/BuyRecord.vue') //购买记录
            },
            {
                path: 'buy',
                name: 'BuyRecord',
                component: () =>
                    import ('@/views/userAdmin/BuyRecord.vue') //购买记录
            },

            {
                path: 'certificate/:id',
                name: 'CertificateView',
                component: () =>
                    import ('@/views/userAdmin/CertificateView.vue') //查看证书
            },
            {
                path: 'explanation',
                name: 'Explanation',
                component: () =>
                    import ('@/views/userAdmin/Explanation.vue') //授权许可
            },
            {
                path: 'vatRecord',
                name: 'VatRecord',
                component: () =>
                    import ('@/views/userAdmin/VatRecord.vue') //发票中心
            },
            {
                path: 'vatInvoice',
                name: 'VatInvoice',
                component: () =>
                    import ('@/views/userAdmin/VatInvoice.vue') //申请发票
            },
            {
                path: 'vatList/:id',
                name: 'vatList',
                component: () =>
                    import ('@/views/userAdmin/VatList.vue') //开发票详情
            },
            {
                path: 'vatId/:id',
                name: 'VatId',
                component: () =>
                    import ('@/views/userAdmin/VatId.vue') //查看已申请发票详情
            },
            {
                path: 'manage',
                name: 'ManagePro',
                component: () =>
                    import ('@/views/userAdmin/ManagePro.vue') //作品管理
            },
            {
                path: 'analyse/:id',
                name: 'Analyse',
                component: () =>
                    import ('@/views/userAdmin/Analyse.vue') //转化分析
            },
            {
                path: 'feedback',
                name: 'Feedback',
                component: () =>
                    import ('@/views/userAdmin/Feedback.vue') //反馈消息
            },
            {
                path: 'chatView/:id',
                name: 'ChatView',
                component: () =>
                    import ('@/views/userAdmin/ChatView.vue') //反馈消息详情
            },
            {
                path: 'collection',
                name: 'Collection',
                component: () =>
                    import ('@/views/userAdmin/Collection.vue') //收藏
            },
            {
                path: 'expenseDetail',
                name: 'ExpenseDetail',
                component: () =>
                    import ('@/views/userAdmin/ExpenseDetail.vue') //收支明细
            },
            {
                path: 'orderInvoice',
                name: 'OrderInvoice',
                component: () =>
                    import ('@/views/userAdmin/OrderInvoice.vue') //订单和发票
            },
            {
                path: 'viewRecord',
                name: 'ViewRecord',
                component: () =>
                    import ('@/views/userAdmin/ViewRecord.vue') //订单和发票
            },
            {
                path: 'upload',
                name: 'Upload',
                component: () =>
                    import ('@/views/userAdmin/Upload.vue') //订单和发票
            },
            {
                path: 'cash',
                name: 'Cash',
                component: () =>
                    import ('@/views/userAdmin/Cash.vue') //提现
            },
            {
                path: 'search',
                name: 'Search',
                component: () =>
                    import ('@/views/userAdmin/Search.vue') //订单和发票
            },
            {
                path: 'down',
                name: 'Down',
                component: () =>
                    import ('@/views/userAdmin/Down.vue') //下载
            },
        ]
    },
    {
        path: '/videoCenter',
        name: 'VideoCenter',
        component: () =>
            import ('@/views/videoCenter/layout/index.vue'),
        redirect: { name: 'VideoList' },
        children: [{
                path: 'searchList/:key',
                name: 'SearchList',
                component: () =>
                    import ('@/views/videoCenter/searchList.vue') //视频搜索结果
            },
            {
                path: 'videoList/:id',
                name: 'VideoList',
                component: () =>
                    import ('@/views/videoCenter/videoList.vue') // 视频列表
            },
            {
                path: 'watch/:id',
                name: 'Watch',
                component: () =>
                    import ('@/views/videoCenter/watch.vue')
            },
            {
                path: 'joinUs',
                name: 'JoinUs',
                component: () =>
                    import ('@/views/userAdmin/joinUs.vue')
            }
        ]
    }
]

const router = new VueRouter({
    routes
})

export default router